<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>布局</title>
    <style>
      .box1 {
        width: 600px;
        background-color: khaki;
        padding: 10px;
      }
      .box1 .left {
        width: 200px;
        height: 200px;
        background-color: skyblue;
        float: left;
      }
      .box1 .right {
        width: 380px;
        height: 200px;
        background-color: pink;
        float: right;
      }

      .clearfix::after {
        display: block;
        content: "";
        clear: both;
      }

      .box2 {
        width: 600px;
        background-color: khaki;
        padding: 10px;
      }
      .box2 .left {
        width: 150px;
        height: 200px;
        background-color: skyblue;
        float: left;
      }
      .box2 .middle {
        width: 280px;
        background-color: aquamarine;
        height: 200px;
        float: left;
        margin-left: 10px;
      }
      .box2 .right {
        width: 150px;
        height: 200px;
        background-color: pink;
        float: right;
      }

      body {
        margin: 0;
      }
      .box3 {
        width: 100%;
        background-color: khaki;
        padding: 10px;
        box-sizing: border-box;
      }
      .box3 .left {
        width: 150px;
        height: 200px;
        background-color: skyblue;
        float: left;
      }
      .box3 .middle {
        background-color: aquamarine;
        height: 200px;
        margin: 0px 160px;
      }
      .box3 .right {
        width: 150px;
        height: 200px;
        background-color: pink;
        float: right;
      }

      .container {
        width: 800px;
        background-color: skyblue;
        margin: 0px auto;
        padding: 5px;
      }
      .item {
        width: 190px;
        height: 200px;
        background-color: khaki;
        float: left;
        margin: 5px;
      }

      ul {
        margin: 0;
      }
      ul {
        padding: 0;
        list-style: none;
      }
      .top {
        height: 50px;
        background-color: skyblue;
      }
      .container {
        width: 1000px;
        margin: 10px auto;
      }
      /*header部分样式*/
      .container .header .logo {
        width: 100px;
        height: 120px;
        background-color: pink;
        float: left;
      }
      .container .header .nav {
        width: 700px;
        float: right;
      }
      .nav .nav-top {
        width: 500px;
        height: 50px;
        background-color: turquoise;
        float: right;
      }
      .nav .nav-bottom {
        height: 60px;
        width: 100%;
        background-color: tomato;
        float: right;
        margin-top: 10px;
      }
      .main {
        margin-top: 20px;
      }
      .main-top .main-top-menu {
        width: 200px;
        height: 500px;
        background-color: lavender;
        float: left;
      }
      .main-top .main-top-content {
        width: 520px;
        height: 500px;

        float: left;
        margin-left: 15px;
      }
      .main-top .main-top-recommend {
        width: 250px;
        height: 500px;
        background-color: orange;
        float: right;
      }
      .main-top-content .top-content-banner {
        height: 300px;
        background-color: tomato;
      }
      .main-top-content .top-content-hot {
        height: 180px;
        margin-top: 20px;
      }
      .top-content-hot ul li {
        width: 120px;
        height: 180px;
        background-color: aquamarine;
        margin: 0px 5px;
        float: left;
      }
      .footer {
        height: 100px;
        background-color: #ddd;
      }
    </style>
  </head>
  <body>
    <h2>左右两列式布局</h2>

    <div class="box1 clearfix">
      <div class="left">左</div>
      <div class="right">右</div>
    </div>

    <h2>一行多列式布局</h2>

    <div class="box2 clearfix">
      <div class="left">左</div>
      <div class="middle">中</div>
      <div class="right">右</div>
    </div>

    <h2>三列式布局，中间自适应</h2>

    <div class="box3 clearfix">
      <div class="left">左</div>
      <div class="right">右</div>
      <div class="middle">中</div>
    </div>

    <h2>多行多列式布局</h2>

    <div class="container clearfix">
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      <div class="item">4</div>
      <div class="item">5</div>
      <div class="item">6</div>
      <div class="item">7</div>
      <div class="item">8</div>
    </div>

    <h2>整站结构布局</h2>

    <div class="top"></div>
    <div class="container">
      <!--header start-->
      <div class="header clearfix">
        <div class="logo"></div>
        <div class="nav clearfix">
          <div class="nav-top"></div>
          <div class="nav-bottom"></div>
        </div>
      </div>
      <!--header end-->
      <!--main start-->
      <div class="main">
        <div class="main-top clearfix">
          <div class="main-top-menu"></div>
          <div class="main-top-content">
            <div class="top-content-banner"></div>
            <div class="top-content-hot">
              <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
              </ul>
            </div>
          </div>
          <div class="main-top-recommend"></div>
        </div>
      </div>
      <!--main start-->
    </div>
    <div class="footer"></div>
  </body>
</html>
